import { createStore } from 'vuex'
import cart from './modules/cart'
import category from './modules/category'
import user from './modules/user'
import createPersistedState from 'vuex-persistedstate'

export default createStore({
  modules: {
    cart,
    category,
    user,
    // 配置插件
    plugins: [
      createPersistedState({
        key: 'www',
        paths: ['user']
      })
    ]
  }
})
